package com.zzyt.myapplication

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.TextView
import com.zzyt.myapplication.bean.Person

class HelloActivity : AppCompatActivity() {

    private lateinit var name: String
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_hello)
        name = "你好"

        val tvName: TextView = findViewById(R.id.tv_name)
        name = getName("我是小菜鸟")

        for (index in 0 until 100){
            Log.e("Stone", "" + index)
        }
        val newName = name + "hhh"

        val preson = Person(newName)
        preson.name = "wod"
        tvName.text = preson.name
        test()
    }

    private fun getName(name: String) = name


    private fun test() {
        var a = 2
        when (a) {
            2 -> Log.e("Stone", "hhhh")
            else -> Log.e("Stone", "else")
        }

    }
}